package com.lixinlei.log.controller;

import com.lixinlei.log.service.SmsCatEnumInstanceMock;
import com.lixinlei.log.util.LogUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 验证 SpringBoot 中默认的日志框架 slf4j 和其模式实现 ch.qos.logback.classic.Logger
 */
@RestController
@RequestMapping("/log")
public class LogController {

    private static final Logger LOG = LoggerFactory.getLogger(LogController.class);

    @GetMapping(value = "/test01")
    public String test01() {
        LogUtil.info(LOG, "com.lixinlei.log.controller.LogController.test01");
        return "success";
    }

    @GetMapping(value = "/test02")
    public String test002() {
        SmsCatEnumInstanceMock.getInstance().send("","","");
        return "success";
    }

}
